#!/bin/bash
pkill -f "python app.py" 2>/dev/null
sleep 2
# 启动 Flask 应用

pkill -f "celery.*app.http.app.celery worker" 2>/dev/null
sleep 3

python app.py &
sleep 4

# 确认没有Celery进程在运行
ps aux | grep celery | grep -v grep

# 重新启动单个worker
#celery -A app.http.app.celery worker --loglevel=info --concurrency=8 --logfile=celery_worker.log

celery -A app.http.app.celery worker --loglevel=info --pool=gevent --concurrency=30 --logfile=celery_worker.log
#celery -A app.http.app.celery worker -P solo -l INFO > celery_worker.log 2>&1 &

wait